package com.spring.mao.user.controller;

import com.spring.mao.user.model.UserModel;
import com.spring.mao.user.services.UserServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.POST;

@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserServices userServices;

    @RequestMapping(value = "/loging",method = GET)
    public String loging(){
        return "succes";
    }

    @RequestMapping(value = "/getUsers",method = POST)
    public List<UserModel> getUsers(UserModel userModel){
        return userServices.getUsers(userModel);
    }
}
